import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int cnt=0;
        sc.nextLine();
        while(cnt<n){
            String str=sc.nextLine();
            for(int i=0;i<str.length();i++){
                System.out.print(str.charAt(i));
            }
            System.out.println();
            System.out.print("AI: ");
            StringBuffer s=new StringBuffer(str);
            cnt++;
        }
    }
    public static void main7(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int cnt=0;
        sc.nextLine();
        while(cnt<n){
            String str=sc.nextLine();
            String[] arr1=str.split(",");
            int num1=arr1[0].length()-1;
            int num2=arr1[1].length()-1;
            String ss=arr1[0].substring(num1-2);
            String sss=arr1[1].substring(num1-3,num2);
            if(arr1[0].substring(num1-2).equals("ong")&&arr1[1].substring(num2-3,num2).equals("ong")){
                StringBuffer s=new StringBuffer(str);
                StringBuffer s1=new StringBuffer();
                int count=0;
                int num=0;
                for(int i=s.length()-1;i>=0;i--){
                    if(s.charAt(i)==' '){
                        count++;
                    }
                    if(count==3){
                        num=i;
                        break;
                    }
                    s1.append(s.charAt(i));
                }
                s1.reverse();
                s.replace(num+1,s.length()-1,"qiao ben zhong");
                for(int i=0;i<s.length();i++){
                    System.out.print(s.charAt(i));
                }
                System.out.println();
            }else{
                System.out.println("Skipped");
            }
            cnt++;
        }
    }
    public static void main6(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int cnt=0;
        while(cnt<n){
            int num=sc.nextInt();
            int a=num%10,b=num%100/10,c=num%1000/100;
            int d=num%10000/1000,e=num%100000/10000,f=num/100000;
            if(a+b+c==d+e+f){
                System.out.println("You are lucky!");
            }else{
                System.out.println("Wish you good luck.");
            }
            cnt++;
        }
    }
    public static void main8(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String[] arr=str.split(" ");
        StringBuffer s=new StringBuffer();
        for(int i=0;i<arr.length;i++){
            if(arr[i].charAt(0)=='6'){
                if(arr[i].length()<=3){
                    s.append(arr[i]+" ");
                }else if(arr[i].length()>9){
                    s.append(27+" ");
                }else{
                    s.append(9+" ");
                }
            }else{
                s.append(arr[i]+" ");
            }
        }
        for(int i=0;i<s.length();i++){
            System.out.print(s.charAt(i));
        }
    }
    public static void main4(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int cnt=0;
        while(cnt<n){
            int sec=sc.nextInt();
            int h=sc.nextInt();
            int w=sc.nextInt();
            if(sec==1){
                if(h<130){
                    System.out.print("duo chi yu! ");
                }else if(h>130){
                    System.out.print("ni li hai! ");
                }else{
                    System.out.print("wan mei! ");
                }
                if(w>27){
                    System.out.print("shao chi rou! ");
                }else if(w<27){
                    System.out.print("duo chi rou! ");
                }else{
                    System.out.print("wan mei! ");
                }
            }else{
                if(h<129){
                    System.out.print("duo chi yu! ");
                }else if(h>129){
                    System.out.print("ni li hai! ");
                }else{
                    System.out.print("wan mei! ");
                }
                if(w>25){
                    System.out.print("shao chi rou! ");
                }else if(w<25){
                    System.out.print("duo chi rou! ");
                }else{
                    System.out.print("wan mei! ");
                }
            }
            System.out.println();
            cnt++;
        }
    }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        double w=sc.nextDouble();
        double h=sc.nextDouble();
        double res=w/(h*h);
        System.out.printf("%.1f\n",res);
        if(res>25){
            System.out.println("PANG");
        }else{
            System.out.println("Hai Xing");
        }
    }
    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        int x=sc.nextInt();
        int y=sc.nextInt();
        int s1=100*100/2;
        int s2=x*y/2;
        int s3=(100+y)*(100-x)/2;
        System.out.println(s1-s2-s3);
    }
}